
/****** Object:  StoredProcedure [dbo].[web_change_card_status]    Script Date: 10/19/2013 09:22:25 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

--IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'web_card_activate')
DROP PROCEDURE web_card_activate
GO

-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[web_card_activate] 
	@action varchar(50),
	@kortele varchar(100)
AS
BEGIN

	SET NOCOUNT ON
	
	If (@action='ACTIVATE')
		UPDATE N51_SUTH set N51_PAV=SUBSTRING(N51_PAV,2,50) where N51_KODAS_KT=@kortele
	else
		UPDATE N51_SUTH set N51_PAV='_' + N51_PAV where N51_KODAS_KT=@kortele


END

GO

